<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon"
	href="http://training-static.linesno.com/switch_run/favicon.ico" />
<title>云主机管理后台</title>
<link
	href="http://training-static.linesno.com/vendor/bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link
	href="http://training-static.linesno.com/sb-admin/css/sb-admin.css"
	rel="stylesheet">
<link
	href="http://training-static.linesno.com/vendor/fontawesome-free/css/all.min.css"
	rel="stylesheet" type="text/css">
<link
	href="http://training-static.linesno.com/vendor/datatables/dataTables.bootstrap4.css"
	rel="stylesheet">

</head>

<body>
	<div class="container-fluid">
		<br />
		<form>
			<input type="hidden" name="id" th:value="${bean.id}" /> <input
				type="hidden" name="serverCode" th:value="${bean.serverCode}" />
			<div class="form-group">
				<label for="exampleInputEmail1">IP地址</label> <input type="text"
					class="form-control" name="serverName"
					th:value="${bean.serverName}" id="exampleInputEmail1"
					aria-describedby="emailHelp" placeholder="IP地址">
			</div>
			<div class="form-group">
				<label for="exampleInputPassword1">主机描述</label> <input type="text"
					class="form-control" name="serverDesc"
					th:value="${bean.serverDesc}" placeholder="主机描述">
			</div>

			<div class="form-group">
				<label for="exampleInputPassword1">排序</label> <input type="text"
					class="form-control" name="serverOrder"
					th:value="${bean.serverOrder}" placeholder="排序">
			</div>

			<div class="form-group">
				<label for="exampleInputPassword1">属性</label> <input type="text"
					class="form-control" name="fieldProp" th:value="${bean.fieldProp}"
					placeholder="属性">
			</div>


			<div class="form-check">
				<input type="checkbox" class="form-check-input" id="exampleCheck1">
				<label class="form-check-label" for="exampleCheck1">禁用</label>
			</div>

			<br />
			<button type="button" onclick="save()"
				class="btn btn-primary btn-lg btn-block">保存</button>
		</form>
	</div>

	<script
		src="http://training-static.linesno.com/vendor/jquery/jquery.min.js"></script>
	<script
		src="http://training-static.linesno.com/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
	<script src="http://training-static.linesno.com/layer/layer.js"></script>

	<script type="text/javascript">
			function save(){
				
				console.log("save") ; 
				var _id = $("input[name=id]").val() ; 
				var _serverCode = $("input[name=serverCode]").val() ; 
				var _serverName = $("input[name=serverName]").val() ; 
				var _serverDesc = $("input[name=serverDesc]").val() ;
				var _serverOrder = $("input[name=serverOrder]").val() ;
				var _fieldProp= $("input[name=fieldProp]").val() ;
				
				$.post("/manager/server_save" , {
					id:_id , 
					serverCode:_serverCode ,
					serverName:_serverName , 
					serverDesc:_serverDesc , 
					fieldProp:_fieldProp, 
					serverOrder:_serverOrder 
				} , function(response){
					console.log("response = " + response) ;
					if(response.code == 200){
						layer.msg(response.message);
					}
				})
			}
		</script>

</body>
</html>
